package chapter04

/**
 * Created with IntelliJ IDEA.
 * ClassName: Test05_While
 * Package: chapter04
 * Description:
 * User: fzykd
 *
 * @Author: LQH
 *          Date: 2023-06-18
 *          Time: 22:23
 */

object Test05_While {
  def main(args: Array[String]): Unit = {
    var a : Int = 10
    while (a >= 1){
      println("this is a while loop: " + a)
      a -= 1
    }

    var b :Int = 0
    //do中代码至少执行一次
    do {
      println("this is a do: " + b)
      b -= 1
    } while (b > 0)

  }
}
